package com.pyrsana.faith.retreat

import java.util.Date;

import com.pyrsana.contact.Address

class Retreat {

    static hasMany = [themeVerses:Passage, attendees:Registration, workshops:Workshop, housings:Housing, transportationLegs:TransportationLeg]

    SortedSet transportationLegs
    Location location
    Date startDate
    Date endDate
    boolean active = true
    String name = ""
    String theme = ""
    String description = ""
    String speakers = ""
    String audience = ""
    String activities = ""
    String whatToBring = ""
    String whatNotToBring = ""
    String notes = ""
    double cost = 0.0
    Date dateCreated
    Date lastUpdated

    static constraints = {
        activities (size:0..2550)
        audience (size:0..2550)
        description (size:0..2550)
        name (size: 1..50, blank: false)
        notes (size:0..2550)
        whatToBring (size:0..2550)
        whatNotToBring (size:0..2550)
    }

    static mapping = {
        transportationLegs cascade: 'all-delete-orphan'
        location cascade: 'all-delete-orphan'
    }
}
